<extend name="Public/base"/>

<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>新增专题</h2>
    </div>
    <form action="{:U()}" method="post" class="form-horizontal">

		<div class='form-item'>
			<label class='item-label'>标题<span class='check-tips'></span></label>
			<div class='controls'>
				<input type='text' class='text input-large' name='title' value=''>
			</div>
		</div>
		<div class='form-item'>
			<label class='item-label'>缩略图<span class='check-tips'></span></label>
			<div class='controls'>
											<input type="file" id="upload_picture_thumb">
									<input type="hidden" name="thumb" id="cover_id_thumb"/>
									<div class="upload-img-box">
									<notempty name="data[thumb]">
										<div class="upload-pre-item"><img src="{$data[thumb]|get_cover='path'}"/></div>
									</notempty>
									</div>
			</div>
									<script type="text/javascript">
								//上传图片
							    /* 初始化上传插件 */
								$("#upload_picture_thumb").uploadify({
							        "height"          : 30,
							        "swf"             : "__STATIC__/uploadify/uploadify.swf",
							        "fileObjName"     : "download",
							        "buttonText"      : "上传图片",
							        "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
							        "width"           : 120,
							        'removeTimeout'	  : 1,
							        'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
							        "onUploadSuccess" : uploadPicturethumb,
							        'onFallback' : function() {
							            alert('未检测到兼容版本的Flash.');
							        }
							    });
								function uploadPicturethumb(file, data){
							    	var data = $.parseJSON(data);
							    	var src = '';
							        if(data.status){
							        	$("#cover_id_thumb").val(data.id);
							        	src = data.url || '__ROOT__' + data.path
							        	$("#cover_id_thumb").parent().find('.upload-img-box').html(
							        		'<div class="upload-pre-item"><img src="' + src + '"/></div>'
							        	);
							        } else {
							        	updateAlert(data.info);
							        	setTimeout(function(){
							                $('#top-alert').find('button').click();
							                $(that).removeClass('disabled').prop('disabled',false);
							            },1500);
							        }
							    }
								</script>
		</div>
		<div class='form-item'>
			<label class='item-label'>描述<span class='check-tips'></span></label>
			<div class='controls'>
			                                <label class="textarea">
                                <textarea name="demo">专题描述</textarea>
                                {:hook('adminArticleEdit', array('name'=>demo,'value'=>专题描述))}
                                </label>
			</div>
		</div>


		<div class='form-item'>
			<label class='item-label'>分类<span class='check-tips'></span></label>
			<div class='controls'>
				                       
                               
			<select name="cid" style="width: 121px;">
			 <volist name="cat" id="vo">
			   <option value="{$vo.id}">{$vo.title}</option>
			 </volist>
			</select>
									   
								
					</div>
		</div>

		<div class='form-item'>
			<label class='item-label'>推荐位<span class='check-tips'></span></label>
			<div class='controls'>
				                       
                                <volist name="pos" id="vo">
                                	<label class="checkbox">
                                    <input type="checkbox" value="{$key}" name="position[]">{$vo}
                                	</label>
                                </volist>
                        
			</div>
		</div>

				<div class='form-item'>
			<label class='item-label'>tag标签<span class='check-tips'></span></label>
			<div class='controls'>
				<input type='text' class='text input-large' name='tag' value=''>
			</div>
		</div>

        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('index')}');
    </script>
</block>
